package top.xchch.tool.cipher.atguigu;

public class AsciiDemo01 {
    public static void main(String[] args) {
//        func1();

        func2();
    }

    /**
     * 字符转数字
     */
    private static void func1() {
        char a = 'A';
        int b = a;
        System.out.println(b);  // 65
    }

    /**
     * 字符串转数字
     */
    private static void func2() {
        String a = "AaZ";
        char[] chars = a.toCharArray();
        for (char ch: chars) {
            int b = ch;
            System.out.println(b);  // 65 97 90
        }
    }
}
